import { OpenFile, Plugin } from "../../core";
import { ReactElement } from "react";

export interface RenderDownloadProps {
  onClick(): void;
}

export interface DownloadMenuItemProps {
  onClick(): void;
}

export interface DownloadProps {
  children?(props: RenderDownloadProps): ReactElement;
}

export interface DownloadPlugin extends Plugin {
  Download: (props: DownloadProps) => ReactElement;
  DownloadButton: () => ReactElement;
  DownloadMenuItem: (props: DownloadMenuItemProps) => ReactElement;
}

export interface DownloadPluginProps {
  // Custom the download file name
  fileNameGenerator?: (file: OpenFile) => string;
}

export interface StoreProps {
  file?: OpenFile;
}
